#include <iostream>
#include "mapfilter_zwk.h"

int main(int argc, char** argv)
{

    Mat stemp,binary_stemp,slamMap_temp;
    stemp = imread( argv[1], 0 );
    
    clock_t start = clock();
    MapFilter_Zwk mapFilter;
    mapFilter.runMapFilter(stemp,stemp);

//    for(int i=0;i<stemp.rows;++i)
//    {
//        for(int j=0;j<stemp.cols;++j)
//        {
//            int pixelValue=(int)stemp.at<uchar>(i,j);
//            if(pixelValue>=50&&pixelValue<240)
//                stemp.at<uchar>(i,j)=205;
//            else{
//                if(pixelValue>=240)
//                    stemp.at<uchar>(i,j)=255;
//                else {
//                    stemp.at<uchar>(i,j)=0;
//                }
//            }
//        }
//    }

    clock_t end   = clock();
    cout << "花费了" << (double)(end - start) / CLOCKS_PER_SEC << "秒" << endl;

//    namedWindow("slamMap_temp", CV_WINDOW_NORMAL);
//    imshow("slamMap_temp",slamMap_temp);
//    imwrite("slamMap_temp.png",slamMap_temp);

    namedWindow("stemp", CV_WINDOW_NORMAL);
    imshow("stemp",stemp);
    imwrite("stemp.png",stemp);

    waitKey(0);
    return 0;
}
